package com.tangfuzhong.proxy;

public class LogInterceptor implements MyInterceptor {

    @Override
    public int getType() {
        return 0;
    }
    @Override
    public Object intercept(MyInvocation myInvocation) throws Exception {
        System.out.println("------log插入前置通知代码-------------");
        Object result = myInvocation.process();
        System.out.println("------log插入后置处理代码-------------");
        return result;
    }

    @Override
    public Object plugin(Object target) {
        return TargetProxy.wrap(target,this);
    }
}
